import React, { Component } from 'react';
//引入三个组件
import Child_ba from './Child3使用contextType';
import Child2_b from './Child2';
import TransferToChild1 from './Child1';
//导入共享数据
import {glabalData,glabalContext,globalAction } from './common/js/globalData'
//合并state状态数据
// 3.结构glabalContent
const {Provider} =glabalContext
class Childparens extends Component{
    //属性（状态）
    state={
        ...glabalData,
        ...globalAction(this)
    }
    //页面
    render(){
        return(
            <Provider value={this.state}>
                <div>父组件读取role=:{this.state.role}</div>
                <Child2_b/>
                <Child_ba/>
                <TransferToChild1/>
            </Provider>
        )
    }
}
export default Childparens